<html>
<head>
    <title>主页</title>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=1.4&ak=GWKMwlzTUGmMqnKCp5rxq6nRsDmefBCW"></script>
<style type="text/css">
    html{height:100%}    
    body{height:650px;margin-top:200px;margin-left: 50px;margin-right: 50px;padding:0px}    
    #container{
       overflow: hidden;
       height:100%;
       margin: 0;
       font-family: "微软雅黑";
   }
   #l-map{overflow: hidden;
       height:450px;
       margin: 0;
       font-family: "微软雅黑";}
   #r-result{width:100%;}

   .info {
   z-index: 999;
   width: auto;
   min-width: 22rem;
   padding: .75rem 1.25rem;
   margin-left: 1.25rem;
   position: fixed;
   top: 1rem;
   background-color: #fff;
   border-radius: .25rem;
   font-size: 14px;
   color: #666;
   box-shadow: 0 2px 6px 0 rgba(27, 142, 236, 0.5);
} 
</style>
</head>
<body>
    <div id="container"></div>
        <script type="text/javascript">
            //初始化地图
            var map = new BMap.Map("container");
            var point = new BMap.Point(100, 100);
            map.centerAndZoom(point, 17);
            //直接添加marker
            var point = new BMap.Point(100, 100);
            var marker = new BMap.Marker(point);
            map.addOverlay(marker);
            addMarkerContextMenu(marker);
            //添加marker右键菜单函数
            function addMarkerContextMenu(marker) {
                var contextMenu = new BMap.ContextMenu();
                contextMenu.addItem(new BMap.MenuItem(("查看坐标"), function () {
                    alert("hello");
                }));
                marker.addContextMenu(contextMenu);
            }
        </script>
</body>
</html>